﻿<UserControl xmlns:my="clr-namespace:BlueMarble.Genesis.Infrastructure.Background.Dynamic"  
		x:Class="BlueMarble.Genesis.Infrastructure.Background.Dynamic.Background"
		xmlns:local="clr-namespace:BlueMarble.Genesis.Infrastructure.Background.Dynamic"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
		xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
		mc:Ignorable="d" 
		MouseMove="BackgroundRoot_MouseMove"
		d:DesignHeight="1080" d:DesignWidth="1920"
		DataContext="{Binding}">
	<UserControl.Resources>
		<Storyboard x:Name="StoryboardControls" x:Key="StoryboardControlsResource">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayerControls"
			 Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)">
				<SplineDoubleKeyFrame x:Name="Translate1ControlsX" KeyTime="00:00:00.500" Value="1">
					<SplineDoubleKeyFrame.KeySpline>
						<KeySpline ControlPoint1="0,0" ControlPoint2="0.504,1"></KeySpline>
					</SplineDoubleKeyFrame.KeySpline>
				</SplineDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayerControls"
			 Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame x:Name="Translate1ControlsY" KeyTime="00:00:00.500" Value="1">
					<SplineDoubleKeyFrame.KeySpline>
						<KeySpline ControlPoint1="0,0" ControlPoint2="0.504,1"></KeySpline>
					</SplineDoubleKeyFrame.KeySpline>
				</SplineDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="StoryboardNear" x:Key="StoryboardNearResource">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayerNear"
			 Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)">
				<SplineDoubleKeyFrame x:Name="Translate1NearX" KeyTime="00:00:00.500" Value="1">
					<SplineDoubleKeyFrame.KeySpline>
						<KeySpline ControlPoint1="0,0" ControlPoint2="0.504,1"></KeySpline>
					</SplineDoubleKeyFrame.KeySpline>
				</SplineDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayerNear"
			 Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame x:Name="Translate1NearY" KeyTime="00:00:00.500" Value="1">
					<SplineDoubleKeyFrame.KeySpline>
						<KeySpline ControlPoint1="0,0" ControlPoint2="0.504,1"></KeySpline>
					</SplineDoubleKeyFrame.KeySpline>
				</SplineDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="StoryboardMiddle" x:Key="StoryboardMiddleResource">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayerMiddle"
			 Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)">
				<SplineDoubleKeyFrame x:Name="Translate1MiddleX" KeyTime="00:00:00.750" Value="1">
					<SplineDoubleKeyFrame.KeySpline>
						<KeySpline ControlPoint1="0,0" ControlPoint2="0.504,1"></KeySpline>
					</SplineDoubleKeyFrame.KeySpline>
				</SplineDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayerMiddle"
			 Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame x:Name="Translate1MiddleY" KeyTime="00:00:00.750" Value="1">
					<SplineDoubleKeyFrame.KeySpline>
						<KeySpline ControlPoint1="0,0" ControlPoint2="0.504,1"></KeySpline>
					</SplineDoubleKeyFrame.KeySpline>
				</SplineDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="StoryboardFar" x:Key="StoryboardFarResource">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayerFar"
			 Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)">
				<SplineDoubleKeyFrame x:Name="Translate1FarX" KeyTime="00:00:00.750" Value="1">
					<SplineDoubleKeyFrame.KeySpline>
						<KeySpline ControlPoint1="0,0" ControlPoint2="0.504,1"></KeySpline>
					</SplineDoubleKeyFrame.KeySpline>
				</SplineDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayerFar"
			 Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame x:Name="Translate1FarY" KeyTime="00:00:00.750" Value="1">
					<SplineDoubleKeyFrame.KeySpline>
						<KeySpline ControlPoint1="0,0" ControlPoint2="0.504,1"></KeySpline>
					</SplineDoubleKeyFrame.KeySpline>
				</SplineDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Name="StoryboardBackground" x:Key="StoryboardBackgroundResource">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayerBackground"
			 Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)">
				<SplineDoubleKeyFrame x:Name="Translate1BackgroundX" KeyTime="00:00:00.750" Value="1">
					<SplineDoubleKeyFrame.KeySpline>
						<KeySpline ControlPoint1="0,0" ControlPoint2="0.504,1"></KeySpline>
					</SplineDoubleKeyFrame.KeySpline>
				</SplineDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="LayerBackground"
			 Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame x:Name="Translate1BackgroundY" KeyTime="00:00:00.750" Value="1">
					<SplineDoubleKeyFrame.KeySpline>
						<KeySpline ControlPoint1="0,0" ControlPoint2="0.504,1"></KeySpline>
					</SplineDoubleKeyFrame.KeySpline>
				</SplineDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>
	<Canvas 
		x:Name="BackgroundCanvas"
		HorizontalAlignment="Stretch" 
		VerticalAlignment="Stretch"
		>
		<local:BackgroundLayer
			x:Name="LayerBackground"
			Margin="-500,-500,500,500" 
			Width="2720" Height="1880" 
			Background="{Binding BackgroundLayerBrush}"
			Canvas.ZIndex="0" >
			<local:BackgroundLayer.RenderTransform>
				<TransformGroup>
					<TranslateTransform X="0" Y="0" />
				</TransformGroup>
			</local:BackgroundLayer.RenderTransform>
		</local:BackgroundLayer>
		<local:ShapeLayer 
			x:Name="LayerFar"
			Margin="-300,-300,300,300" 
			Width="2520" Height="1680" 
			Canvas.ZIndex="1"
			Shape="{Binding Shape}"
			Scale="0.2"
			Opacity="0.2">
			<local:ShapeLayer.RenderTransform>
				<TransformGroup>
					<TranslateTransform X="0" Y="0" />
				</TransformGroup>
			</local:ShapeLayer.RenderTransform>
		</local:ShapeLayer>
		<local:ShapeLayer 
			x:Name="LayerMiddle"
			Margin="-300,-300,300,300" 
			Width="2520" Height="1680" 
			Canvas.ZIndex="10"
			Shape="{Binding Shape}"
			Scale="0.4"
			Opacity="0.4">
			<local:ShapeLayer.RenderTransform>
				<TransformGroup>
					<TranslateTransform X="0" Y="0" />
				</TransformGroup>
			</local:ShapeLayer.RenderTransform>
		</local:ShapeLayer>
		<local:ShapeLayer 
			x:Name="LayerNear"
			Margin="-300,-300,300,300" 
			Width="2520" Height="1680" 
			Canvas.ZIndex="100"
			Shape="{Binding Shape}"
			Scale="0.6"
			Opacity="0.6">
			<local:ShapeLayer.RenderTransform>
				<TransformGroup>
					<TranslateTransform X="0" Y="0" />
				</TransformGroup>
			</local:ShapeLayer.RenderTransform>
		</local:ShapeLayer>
		<local:ControlLayer 
			x:Name="LayerControls"
			Canvas.ZIndex="1000" 
			Content="{Binding Content}"
			HorizontalAlignment="Stretch" 
            HorizontalContentAlignment="Stretch"
			VerticalAlignment="Stretch"
            VerticalContentAlignment="Stretch">
			<local:ControlLayer.RenderTransform>
				<TransformGroup>
					<TranslateTransform X="0" Y="0" />
				</TransformGroup>
			</local:ControlLayer.RenderTransform>
		</local:ControlLayer>
	</Canvas>
</UserControl>
